package patrol.mobile.com.mobilepatrol.adapter;

import android.content.Context;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import java.util.List;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.BaseActivity;
import patrol.mobile.com.mobilepatrol.bean.MessageBean;

/**
 * Created by K on 2018/9/7.
 * des:消息适配器
 */
public class MessageAdapter extends BaseQuickAdapter<MessageBean> {
    private Context mContext;

    public MessageAdapter(Context context) {
        super(context);
        this.mContext = context;
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_message;
    }

    @Override
    protected void convert(BaseViewHolder holder, MessageBean item) {
        holder.setText(R.id.tv_num, (holder.getAdapterPosition() + 1) + "");
        holder.setText(R.id.tv_title, item.getTitle());//标题
        holder.setText(R.id.tv_state, item.getStatus());//状态
        holder.setText(R.id.tv_time, item.getSendDate());//时间
        holder.setText(R.id.tv_name, item.getSender() + "发");//发送人
    }
}
